﻿using WeDonekRpc.Client;
using WeDonekRpc.Client.Interface;
using RpcStore.RemoteModel.Transmit;
using RpcStore.RemoteModel.Transmit.Model;
using RpcStore.Service.Interface;

namespace RpcStore.Service.Event
{
    internal class TransmitEvent : IRpcApiService
    {
        private readonly IServerTransmitService _Service;
        public TransmitEvent (IServerTransmitService service)
        {
            this._Service = service;
        }
        public PagingResult<TransmitServer> QueryTransmit (QueryTransmit query)
        {
            return this._Service.Query(query.Query, query.ToBasicPage());
        }
        public void DeleteTransmit (DeleteTransmit obj)
        {
            this._Service.Delete(obj.Id);
        }
        public void AddTransmit (AddTransmit add)
        {
            this._Service.Add(add.Datum);
        }
        public void SetTransmit (SetTransmit obj)
        {
            this._Service.Set(obj.Id, obj.TransmitConfig);
        }
        public TransmitConfig[] GetTransmits (GetTransmits obj)
        {
            return this._Service.GetTransmits(obj.Id);
        }
    }
}
